home *** CD-ROM | disk | FTP | other *** search
- #! /bin/sh
-
- # usage: direq dir1 dir2
-
- # test whether directories dir1 and dir2 are the same directory
-
- # returns false if not, or if either is not a directory
-
- dir1=$1
- dir2=$2
-
- if [ ! -d $dir1 -o ! -d $dir2 ] ; then
- exit 1;
- fi
-
- path1=`(cd $dir1;/bin/pwd)`
- path2=`(cd $dir2;/bin/pwd)`
-
- if [ "$path1" != "$path2" ] ; then
- exit 1
- fi
-
- exit 0
-